//
//  LoginViewController.h
//  Growth
//
//  Created by Hobo.Chen on 12/30/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//
/*
 登陆系统
 */

#import <UIKit/UIKit.h>
#import "PushUpViewController.h"



#import "WebRequest.h"
#import "WebConnetionArray.h"

#import "RequestAPIExample.h"

#import "ContentUnitViewController.h"

#import "ThirdPartLoginViewController.h"


// qq
#import "TencentOAuth.h"

#define QQAccessToken @"QQAccessToken"
#define QQExpirationDate @"QQExpirationDate"
#define QQOpenId @"QQOpenId"
#define QQAPPKey @"100260065"

//weibo
#import "WBEngine.h"
#import "WBSendView.h"
#import "WBLogInAlertView.h"

//系统
#define kWBSDKDemoAppKey @"4262987471"
#define kWBSDKDemoAppSecret @"7bbf7a1c3ca68db9e5a4041a23329ada"

//魔幻古筝
//#define kWBSDKDemoAppKey @"2543383452"
//#define kWBSDKDemoAppSecret @"48d94c24940b30132e7f0e32ee2f1986"

//儿童智力魔板
//#define kWBSDKDemoAppKey @"2051441578"
//#define kWBSDKDemoAppSecret @"fb699c74c3595d38442b8636ce0d59e2"

#ifndef kWBSDKDemoAppKey
#error
#endif

#ifndef kWBSDKDemoAppSecret
#error
#endif

#define kWBAlertViewLogOutTag 100
#define kWBAlertViewLogInTag  101


#define kWBKeychainAccessToken          @"WeiBoAccessToken"

@protocol LoginViewControllerDelegate;

@interface LoginViewController : PushRightViewController <WebConnectionArrayDelegate,TencentSessionDelegate,
ThirdPartViewControllerDelegate,
PushViewDelegate,
WBEngineDelegate,
WBLogInAlertViewDelegate,
UITextFieldDelegate> {
	UITextField *loginIDtextField;
	UITextField *loginkeytextField;
    
    
    int oauthType;  //
  
    BOOL getUserIdSucced;
    
    //qq
      TencentOAuth* _tencentOAuth;
		NSMutableArray* _permissions; 
    NSDictionary *qq_userInfo_dict;
    
    
    UIButton *backGroundButton;
    
    //weibo
    WBEngine *weiBoEngine;
    NSDictionary *weibo_userInfo_dict;
    
    
}
@property (assign) id<LoginViewControllerDelegate> delegate; 

@property (nonatomic) int oauthType;

@property(nonatomic,retain)IBOutlet UITextField *loginIDtextField;
@property(nonatomic,retain)IBOutlet UITextField *loginkeytextField;

//qq
@property(nonatomic,retain)  NSDictionary *qq_userInfo_dict;

//weibo

@property (nonatomic, retain) WBEngine *weiBoEngine;
@property (nonatomic,retain)  NSDictionary *weibo_userInfo_dict;

@property (nonatomic,retain) IBOutlet  UIButton *backGroundButton;


//third part
-(void)verifyToken;
-(void)openCheck:(NSString *)token;
-(void)createNewQQUser:(NSString *)nickName;
-(void)bindQQUser:(NSString *)email key:(NSString *)pass;


-(void)loadThirdPartView;

//buttonAction

-(IBAction)loginAction;
-(IBAction)QQloginAction:(id)sender;
-(IBAction)sinaLoginAction:(id)sender;
-(IBAction)registerNowActon;

-(IBAction)backgroundTap:(id)sender;


//真正用的
-(IBAction)QQ2loginAction;
-(IBAction)weiboLoginAction;

//下载可管理的时间轴
-(void)loadTimelineMember:(int)uid;

//登陆成功
- (void)userLoginSuccess;


@end


//Delegate
@protocol LoginViewControllerDelegate <NSObject>
@optional 

//reload data
-(void)reloadData;

//Third part qq
- (void)onClickGetUserInfo;


@end
